﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AutomationView
{
    public class Operation
    {
        public Operation(string name) { this.Name = name; }

        public Operation(string name, params object[] args):this(name)
        {
            this.Arguments = args;
        }

        public string Name { get; private set; }

        public object[] Arguments { get; private set; }

        public Operation UseArguments(params object[] args)
        {
            this.Arguments = args;
            return this;
        }

        public override string ToString()
        {
            return String.Format("Operation: {0}", this.Name);
        }

        public static Operation Empty = new Operation("Empty");

    }

    public class Operation<T>:Operation
    {
        public Operation(string name, T arg):base(name)
        {
            this.Argument = arg;
        }

        public Operation(string name):base(name)
        {
        }

        public T Argument { get; set; }
    }
}
